use 5.008;

use strict;
use warnings;

use ExtUtils::MakeMaker;

unless ($^O eq "MSWin32" || $^O eq "cygwin") {
    die "OS unsupported\n";
}

my %param = (
    NAME              => 'Win32::OleAccxs',
    VERSION_FROM      => 'lib/Win32/OleAccxs.pm', # finds $VERSION
    PREREQ_PM         => {}, # e.g., Module::Name => 1.1
    ABSTRACT_FROM     => 'lib/Win32/OleAccxs.pm',
    AUTHOR            => 'Yi Zhao <zzlinux@hotmail.com>',
    XS                => { 'OleAccxs.xs' => 'OleAccxs.cpp' },
    LIBS              => ['-loleacc'], # e.g., '-lm'
    DEFINE            => '-DWINVER=0x0502 -D_WIN32_WINNT=0x0502', # e.g., '-DHAVE_SOMETHING'
    INC               => '-I.', # e.g., '-I. -I/usr/include/other'
	# Un-comment this if you add C files to link with later:
    # OBJECT            => '$(O_FILES)', # link all the C files too
);

WriteMakefile(%param);

package MY;

sub MY::xs_c {
    '
.xs.cpp:
	$(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) $(XSUBPP) $(XSPROTOARG) $(XSUBPPARGS) $*.xs >xstmp.c && $(MV) xstmp.c $*.cpp
';
}

